<template>
  <!-- 活动新增的输入框模块 -->
  <div>
    <FormPanel ref="formPanel" :scrollContainer="jumpform" :list="formList" :cols="3" :labelWidth="110" formType="add" :isSubmitBtn="false" @formChange="formChangeHandle" />
    <div>
      <LazyLoadTab v-model="activeName" position="left" :tabMenus="menus"></LazyLoadTab>
    </div>
    <div v-show="false">
      <actscope ref="actscope"></actscope>
    </div>
    <div v-show="false">
      <actcontent ref="actcontent"></actcontent>
    </div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <multiuse-button size="small" icon="el-icon-folder-add" :click="save" type="primary">保存</multiuse-button>
      <el-button size="small" icon="el-icon-refresh-left" type="primary" @click="closeDialog">取消</el-button>
    </div>
  </div>
</template>
<script>
import moment from 'moment';
import { dictionary } from '@/utils/dictMixin';
import { addActivity, details, detailsPjxm, detailsFjxm, detailsWxxm, detailsActscope } from '@/api/repair/repair/activitesManage';
import actscope from './actscope';
import actcontent from './actcontent';
import { getWxlxSelect } from '@/api/repair/repairReception/customer';
export default {
  name: 'addActivity',
  components: {
    actscope,
    actcontent
  },
  mixins: [dictionary],
  props: ['type', 'detaildata'],
  data() {
    this.saveData = {};
    return {
      //   type默认为1新增     2为编辑
      formadd: false,
      formList: this.createFormList(),
      jumpform: null,
      cunwxxm: [],
      cunpjxm: [],
      cunfjxm: [],
      cunactcsope: [],
      cunDeletewxxm: [],
      cunDeletepjxm: [],
      cunDeletefjxm: [],
      cunDeleteactcsope: [],
      activeName: '活动内容',
      menus: this.listMenus(),
      wxxm: 0, // wxxm页总金额
      pjxm: 0, // pjxm页总金额
      fjxm: 0, // fjxm页总金额
      repairTypeList: [] // 维修类型
    };
  },
  created() {
    // this.FwhdMxlist(this.rowsData);
  },
  mounted() {
   this.jumpform = document.querySelector('.scroll-wrapper');
    if (this.type == 1) {
      this.formList.find(x => x.fieldName === 'isRepeatAttend').initialValue = 10041001;
    } else if (this.type == 2) {
      this.formList.find(x => x.fieldName === 'activityCode').disabled = true;
      this.details();
      this.detailsWxxm();
      //  还差两个没弄  / 明天弄
      this.detailsPjxm();
      this.detailsFjxm();
    }
    this.getWxlxSelect();
  },
  methods: {
    // 获取详情信息方法
    async details() {
      let res = await details(this.detaildata);
      this.formList.find(x => x.fieldName === 'transferClassCode').initialValue = res.data['transferClassCode'];
      this.formList.find(x => x.fieldName === 'isActityBooking').initialValue = res.data['isActityBooking'];
      this.formList.find(x => x.fieldName === 'transferFlag').initialValue = res.data['transferFlag'];
      this.formList.find(x => x.fieldName === 'isActity').initialValue = res.data['isActity'];
      this.formList.find(x => x.fieldName === 'isRepeatAttend').initialValue = res.data['isRepeatAttend'];
      this.formList.find(x => x.fieldName === 'priorityTransferFlag').initialValue = res.data['priorityTransferFlag'];
      this.formList.forEach(x => {
        if (x.fieldName == 'beginDate|endDate') {
          x.initialValue = [res.data.beginDate.substr(0, 10) + ' 00:00:00', res.data.endDate.substr(0, 10) + ' 00:00:00'];
        } else if (x.fieldName == 'salesDateBegin|salesendDate') {
          x.initialValue = [res.data.salesDateBegin.substr(0, 10) + ' 00:00:00', res.data.salesendDate.substr(0, 10) + ' 00:00:00'];
        } else if (x.fieldName === 'activityAmount') {
          if (res.data[x.fieldName] == null || res.data[x.fieldName] == '') {
            x.initialValue = 0;
          } else {
            x.initialValue = res.data[x.fieldName].toFixed(2);
          }
        } else if (x.fieldName === 'activityType') {
          x.initialValue = res.data[x.fieldName] ? parseInt(res.data[x.fieldName]) : null;
        } else {
          x.initialValue = res.data[x.fieldName];
        }
      });
    },
    closeDialog() {
      if (this.type == 1) {
        this.$emit('close', false);
      } else if (this.type == 2) {
        this.$emit('EditAddActivity', false);
      }
    },
    listMenus() {
      let that = this;
      return [
        {
          title: '活动内容',
          path: 'repair/activitiesManage/activitiesManage/actcontent',
          params: {
            type: that.type,
            detaildata: that.detaildata
          },
          on: {
            handleDeletedone(val) {
              //  alert('1')
              console.log(val, 'shanchu');
              val.is_del = '123';
              val.LABOUR_AMOUNT_DISCOUNT = 0;
              that.cunDeletewxxm.splice(val, 1);
            },
            handleDeletedtwo(val) {
              // alert('2')
              console.log(val, 'shanchu');
              val.is_del = '123';
              val.PART_SALES_AMOUNT_DISCOUNT = 0;
              that.cunDeletepjxm.splice(val, 1);
            },
            handleDeletedthree(val) {
              //  alert('3')
              console.log(val, 'shanchu');
              val.is_del = '123';
              val.RECEIVE_AMOUNT = 0;
              that.cunDeletefjxm.splice(val, 1);
            },
            changeoneF(val) {
              that.cunwxxm = [];
              if (val.length > 0) {
                val.forEach(x => {
                  if (that.type == 1) {
                    x.fag = 'A';
                  } else if (that.type == 2) {
                    x.fag = 'U';
                  }
                  that.cunwxxm.push(x);
                });
              }
            },
            // 计算活动总金额  wxxm页金额
            wxxmTotal(val) {
              that.wxxm = Number(val);
              that.formList.find(x => x.fieldName === 'activityAmount').initialValue = Number(val) + Number(that.pjxm) + Number(that.fjxm);
              that.formList.find(x => x.fieldName === 'activityAmount').initialValue = that.formList.find(x => x.fieldName === 'activityAmount').initialValue.toFixed(2);
            },
            changetwoF(val) {
              that.cunpjxm = [];
              if (val.length > 0) {
                val.forEach(x => {
                  if (x.CLAIM_PRICE == null) {
                    x.CLAIM_PRICE = 0;
                  }
                  if (that.type == 1) {
                    x.fag = 'A';
                  } else if (that.type == 2) {
                    x.fag = 'U';
                  }
                  that.cunpjxm.push(x);
                });
              }
            },
            // 计算活动总金额  pjxm页金额
            pjxmTotal(val) {
              that.pjxm = Number(val);
              that.formList.find(x => x.fieldName === 'activityAmount').initialValue = Number(val) + Number(that.wxxm) + Number(that.fjxm);
              that.formList.find(x => x.fieldName === 'activityAmount').initialValue = that.formList.find(x => x.fieldName === 'activityAmount').initialValue.toFixed(2);
            },
            changethreeF(val) {
              that.cunfjxm = [];
              if (val.length > 0) {
                val.forEach(x => {
                  if (that.type == 1) {
                    x.fag = 'A';
                  } else if (that.type == 2) {
                    x.fag = 'U';
                  }
                  that.cunfjxm.push(x);
                });
              }
            },
            // 计算活动总金额  fjxm页金额
            fjxmTotal(val) {
              that.fjxm = Number(val);
              that.formList.find(x => x.fieldName === 'activityAmount').initialValue = Number(val) + Number(that.wxxm) + Number(that.pjxm);
              that.formList.find(x => x.fieldName === 'activityAmount').initialValue = that.formList.find(x => x.fieldName === 'activityAmount').initialValue.toFixed(2);
            }
          }
        },
        {
          title: '活动范围',
          path: 'repair/activitiesManage/activitiesManage/actscope',
          params: {
            // ACTIVITY_CODE: this.rowsData.ACTIVITY_CODE
            type: that.type,
            detaildata: that.detaildata
          },
          on: {
            changeEmptyone(val) {
              that.cunactcsope = [];
              if (val.length > 0) {
                val.forEach(x => {
                  if (that.type == 1) {
                    x.fag = 'A';
                  } else if (that.type == 2) {
                    x.fag = 'U';
                  }
                  that.cunactcsope.push(x);
                });
              }
            },
            handleDeleted(val) {
              //  alert('4')
              console.log(val, 'shanchu');
              val.is_del = '123';
              that.cunDeleteactcsope.push(val);
            }
          }
        }
      ];
    },
    formChangeHandle(val) {
      console.log(val, 'val');
      // 这里做校验
      if (val.salesBeginDay != '' && val.salesBeginDay != null && val.salesBeginDay != undefined && val.salesEndDay != '' && val.salesEndDay != null && val.salesEndDay != undefined) {
        if (Number(val.salesBeginDay) >= Number(val.salesEndDay)) {
          this.$notify({
            title: '警告',
            message: '销售天数起始值不能大于等于终值',
            type: 'warning'
          });
          return;
        }
      }
      if (val.mileageBegin != '' && val.mileageBegin != null && val.mileageBegin != undefined && val.mileageEnd != '' && val.mileageEnd != null && val.mileageEnd != undefined) {
        if (Number(val.mileageBegin) >= Number(val.mileageEnd)) {
          this.$notify({
            title: '警告',
            message: '行驶里程起始值不能大于等于终值',
            type: 'warning'
          });
          return;
        }
      }
      if (val.salesDateBegin != '' && val.salesDateBegin != null && val.salesDateBegin != undefined && val.salesendDate != '' && val.salesendDate != null && val.salesendDate != undefined) {
        let startTime = new Date(val.salesDateBegin); // 开始时间
        let endTime = new Date(val.salesendDate); // 结束时间
        let usedTime = endTime - startTime; // 相差的毫秒数
        if (usedTime <= 0) {
          this.$notify({
            title: '警告',
            message: '销售开始日期不能大于等于销售结束日期',
            type: 'warning'
          });
          return;
        }
      }
      let startTime = new Date(val.beginDate); // 开始时间
      let endTime = new Date(val.endDate); // 结束时间
      let usedTime = endTime - startTime; // 相差的毫秒数
      if (usedTime < 0) {
        this.$notify({
          title: '警告',
          message: '开始日期不能大于结束日期',
          type: 'warning'
        });
        return;
      }
      if (val.businessType == '') {
        val.businessType = null;
      }
      Object.assign(this.saveData, val);
      if (this.type == 1) {
        this.saveData.fag = 'A';
      } else if (this.type == 2) {
        this.saveData.fag = 'U';
      }
      // 判断总金额是否为空
      if (this.saveData.activityAmount == '' || this.saveData.activityAmount == null) {
        this.saveData.activityAmount = 0;
      }
      this.saveData.labourList = []; // 维修项目wxxm
      this.saveData.partList = []; // 备件pj
      this.saveData.subjoinList = []; // 附加项目fj
      this.saveData.modelList = []; // 活动车型hd
      this.saveData.vehicleList = []; //

      this.saveData.labourList = this.cunwxxm;
      this.saveData.partList = this.cunpjxm;
      this.saveData.subjoinList = this.cunfjxm;
      this.saveData.modelList = this.cunactcsope;
      if (this.cunDeletewxxm.length > 0) {
        this.cunDeletewxxm.forEach(x => {
          this.saveData.labourList.push(x);
        });
      }
      if (this.cunDeletepjxm.length > 0) {
        this.cunDeletepjxm.forEach(x => {
          this.saveData.partList.push(x);
        });
      }
      if (this.cunDeletefjxm.length > 0) {
        this.cunDeletefjxm.forEach(x => {
          this.saveData.subjoinList.push(x);
        });
      }
      if (this.cunDeleteactcsope.length > 0) {
        this.cunDeleteactcsope.forEach(x => {
          this.saveData.modelList.push(x);
        });
      }
      if (this.saveData.transferClassCode) {
        this.repairTypeList.map(x => {
          if (x.value == this.saveData.transferClassCode) {
            this.saveData.transferClassName = x.text;
          }
        });
      }
      this.formadd = true;
    },
    async save() {
      this.$refs.actscope.ceshi('actscope');
      this.$refs.actcontent.ceshi('actcontent');
      this.$refs.formPanel.SUBMIT_FORM();
      this.saveData.partList.forEach(x => {
        let OLD_LABOUR_CODE = x.LABOUR_CODE;
        if (OLD_LABOUR_CODE.indexOf('~') != -1) {
          x.LABOUR_CODE = OLD_LABOUR_CODE.split('~')[0];
          x.UID_HIDDEN = OLD_LABOUR_CODE.split('~')[1];
        }
      });
      let flag = true;
      this.saveData.subjoinList.forEach(x => {
        if (x.ADD_ITEM_AMOUNT <= 0 || x.DISCOUNT <= 0) {
          this.$notify({
            title: '警告',
            message: '附加项目费和折扣率必须大于零',
            type: 'warning'
          });
          flag = false;
          return;
        }
      });
      for (let i = 0; i < this.saveData.subjoinList.length; i++) {
        console.log(this.saveData);
        if (this.saveData.subjoinList[i].CHARGE_PARTITION_CODE == '') {
          this.$notify({
            title: '警告',
            message: '附加项目中第' + (i + 1) + '行收费区分不能为空',
            type: 'warning'
          });
          flag = false;
          return;
        }
      }
      for (let i = 0; i < this.saveData.labourList.length; i++) {
        console.log("+++++++++++++++++"+this.saveData.labourList);
        if (this.saveData.labourList[i].LABOUR_PRICE == '') {
          this.$notify({
            title: '警告',
            message: '维修项目中第' + (i + 1) + '行工时单价不能为空',
            type: 'warning'
          });
          flag = false;
          return;
        }
      }
      for (let i = 0; i < this.saveData.labourList.length; i++) {
        console.log(this.saveData);
        if (this.saveData.labourList[i].CHARGE_PARTITION_CODE == '') {
          this.$notify({
            title: '警告',
            message: '维修项目中第' + (i + 1) + '行收费区分不能为空',
            type: 'warning'
          });
          flag = false;
          return;
        }
      }
      for (let i = 0; i < this.saveData.partList.length; i++) {
        console.log(this.saveData);
        if (this.saveData.partList[i].CHARGE_PARTITION_CODE == '') {
          this.$notify({
            title: '警告',
            message: '维修材料中第' + (i + 1) + '行收费区分不能为空',
            type: 'warning'
          });
          flag = false;
          return;
        }
      }
      this.saveData.partList.forEach(x => {
        if (x.PART_SALES_PRICE <= 0 || x.PART_QUANTITY <= 0 || x.DISCOUNT <= 0) {
          this.$notify({
            title: '警告',
            message: '备件数量、备件销售单价和折扣率必须大于零',
            type: 'warning'
          });
          flag = false;
          return;
        }
      });
      if (this.formadd && flag) {
        console.log(this.saveData);
        const res = await addActivity(this.saveData);
        if (res.resultCode == 200) {
          this.$notify.success({ title: '提示信息', message: '保存成功！' });
          this.$emit('close');
        }
      }
    },
    createFormList() {
      return [
        {
          type: 'INPUT',
          label: '活动代码',
          fieldName: 'activityCode',
          disabled: false,
          placeholder: '',
          maxlength: 8,
          rules: [
            { required: true, message: '请输入活动代码', trigger: 'change' },
            { pattern: /^[0-9a-zA-Z]{1,8}$/, message: '内容只能为英文或数字', trigger: 'change' }
          ]
        },
        {
          type: 'INPUT',
          label: '活动名称',
          fieldName: 'activityName',
          placeholder: '',
          rules: [{ required: true, message: '请输入活动名称', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '活动总金额',
          fieldName: 'activityAmount',
          disabled: true,
          placeholder: '',
          initialValue: ''
          // rules: [{ required: true, message: '请输入角色名称', trigger: 'blur' }]
        },
        {
          type: 'RANGE_DATE',
          label: '开始-结束日期',
          fieldName: 'beginDate|endDate',
          placeholder: '',
          selfCols: 2,
          rules: [{ required: true, message: '请输入开始-结束日期', trigger: 'blur' }]
        },
        // {
        //   type: 'DATE',
        //   label: '开始-结束日期',
        //   fieldName: 'beginDate',
        //   placeholder: '',
        //   // valueFormat: 'yyyy-MM-dd',
        //   rules: [{ required: true, message: '请输入开始-结束日期', trigger: 'blur' }]
        // },
        // {
        //   type: 'DATE',
        //   label: '至',
        //   fieldName: 'endDate',
        //   placeholder: '',
        //   // valueFormat: 'yyyy-MM-dd',
        //   rules: [{ required: true, message: '请输入开始-结束日期', trigger: 'blur' }]
        // },
        {
          type: 'SELECT',
          label: '业务类型',
          fieldName: 'businessType',
          // disabled: true,
          placeholder: '',
          // itemList:[]
          itemList: this.createDictList('8047')
          // rules: [{ required: true, message: '请输入角色名称', trigger: 'blur' }]
        },
        {
          type: 'RANGE_DATE',
          label: '销售日期',
          fieldName: 'salesDateBegin|salesendDate',
          placeholder: '',
          selfCols: 2
        },
        // {
        //   type: 'DATE',
        //   label: '销售日期',
        //   placeholder: '',
        //   // valueFormat: 'yyyy-MM-dd',
        //   fieldName: 'salesDateBegin'
        // },
        // {
        //   type: 'DATE',
        //   label: '至',
        //   placeholder: '',
        //   // valueFormat: 'yyyy-MM-dd',
        //   fieldName: 'salesendDate'
        // },
        // {
        //   type: 'SELECT',
        //   label: '活动类型',
        //   fieldName: 'activityType',
        //   disabled: true,
        //   placeholder: '',
        //   itemList: this.createDictList('8080')
        // },
        {
          type: 'SELECT',
          label: '活动类型',
          fieldName: 'activityType',
          placeholder: '请选择...',
          disabled: true,
          itemList: this.createDictList('8080')
        },
        {
          type: 'INPUT',
          label: '行驶里程',
          fieldName: 'mileageBegin',
          placeholder: '',
          rules: [{ pattern: /^[0-9]*$/, message: '请输入数字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '至',
          fieldName: 'mileageEnd',
          placeholder: '',
          rules: [{ pattern: /^[0-9]*$/, message: '请输入数字', trigger: 'blur' }]
        },
        //   {
        //   type: 'SELECT',
        //   label: '是否备件活动',
        //   fieldName: 'isPartActivity',
        //   placeholder: '',
        //   itemList: this.createDictList('1004')
        // },
        {
          type: 'SELECT',
          label: '是否默认参与',
          fieldName: 'isActity',
          placeholder: '',
          initialValue: '',
          itemList: this.createDictList('1004')
        },
        {
          type: 'INPUT',
          label: '销售天数',
          fieldName: 'salesBeginDay',
          placeholder: '',
          rules: [{ pattern: /^[0-9]*$/, message: '请输入数字', trigger: 'blur' }]
        },
        {
          type: 'INPUT',
          label: '至',
          fieldName: 'salesEndDay',
          placeholder: '',
          rules: [{ pattern: /^[0-9]*$/, message: '请输入数字', trigger: 'blur' }]
        },
        // {
        //   type: 'SELECT',
        //   label: '备件是否可编辑',
        //   fieldName: 'partsIsModify',
        //   placeholder: '',
        //   initialValue: '',
        //   itemList: this.createDictList('1004')
        // },
        {
          type: 'SELECT',
          label: '是否多次参加活动',
          fieldName: 'isRepeatAttend',
          placeholder: '',
          initialValue: '',
          itemList: this.createDictList('1004')
        },
        {
          type: 'SELECT',
          hidden:true,
          label: '是否邀约',
          fieldName: 'isActityBooking',
          placeholder: '',
          initialValue: '',
          itemList: this.createDictList('1004')
        },
        {
          type: 'CHECKBOX',
          hidden:true,
          label: '强制转单标识',
          fieldName: 'transferFlag',
          initialValue:'0',
          options: {
            trueValue: '1',
            falseValue: '0'
          }
        },
        {
          type: 'CHECKBOX',
          hidden:true,
          label: '优先转单标识',
          fieldName: 'priorityTransferFlag',
          initialValue:'0',
          options: {
            trueValue: '1',
            falseValue: '0'
          }
        },
        {
          type: 'SELECT',
          hidden:true,
          label: '强制转单类别',
          fieldName: 'transferClassCode',
          itemList: []
        }
      ];
    },
    async getFwhdXqList(row) {
      const res = await getFwhdXqList(row);
      this.formList.forEach(x => {
        if (x.fieldName === 'ACTIVITY_KIND') {
          x.initialValue = Number(res[x.fieldName]);
        } else if (
          x.fieldName === 'BEGIN_DATE' ||
          x.fieldName === 'END_DATE' ||
          x.fieldName === 'SALES_DATE_BEGIN' ||
          x.fieldName === 'SALES_DATE_END' ||
          x.fieldName === 'MAINTAIN_BEGIN_DATE' ||
          x.fieldName === 'MAINTAIN_END_DATE'
        ) {
          x.initialValue = moment(res[x.fieldName]).format('YYYY-MM-DD');
        } else {
          x.initialValue = res[x.fieldName];
        }
      });
    },
    async getbrandList() {
      const res = await getbrandList();
    },
    // 拿到Wxxm页total
    async detailsWxxm() {
      let res = await detailsWxxm(this.detaildata);
      this.wxxm = 0;
      res.data.rows.forEach(x => {
        if (x.REPAIR_TYPE_CODE != null) {
          x.REPAIR_TYPE_CODE = Number(x.REPAIR_TYPE_CODE);
        } else {
          x.REPAIR_TYPE_CODE = null;
        }
        if (x.LABOUR_PRICE != null) {
          x.LABOUR_PRICE = Number(x.LABOUR_PRICE);
        } else {
          x.LABOUR_PRICE = null;
        }
        // STD_LABOUR_HOUR收费工时
        // ASSIGN_LABOUR_HOUR派工工时
        // LABOUR_PRICE工时单价
        // LABOUR_AMOUNT工时费
        // DISCOUNT折扣率
        // LABOUR_AMOUNT_DISCOUNT折扣后工时费
        if (x.LABOUR_PRICE != '' && x.LABOUR_PRICE != null && x.LABOUR_PRICE != undefined) {
          x.LABOUR_AMOUNT = Number(x.STD_LABOUR_HOUR) * Number(x.LABOUR_PRICE);
        }
        if (isNaN(Number(x.DISCOUNT))) {
          x.LABOUR_AMOUNT_DISCOUNT = 0;
        } else {
          x.LABOUR_AMOUNT_DISCOUNT = Number(x.LABOUR_AMOUNT) * Number(x.DISCOUNT);
        }
        if (x.LABOUR_PRICE === 0) {
          x.LABOUR_PRICE = '';
        }
        this.wxxm = Number(x.LABOUR_AMOUNT_DISCOUNT) + this.wxxm;
      });
    },
    // 拿到Pjxm页total
    async detailsPjxm() {
      this.pjxm = 0;
      let res = await detailsPjxm(this.detaildata);
      // PART_QUANTITY   备件数量
      // PART_SALES_PRICE备件销售单价
      // PART_SALES_AMOUNT备件销售金额
      // DISCOUNT折扣率
      // PART_SALES_AMOUNT_DISCOUNT折扣后金额合计
      res.data.rows.forEach(x => {
        if (isNaN(Number(x.DISCOUNT))) {
          x.PART_SALES_AMOUNT_DISCOUNT = 0;
        } else {
          x.PART_SALES_AMOUNT_DISCOUNT = Number(x.PART_SALES_AMOUNT) * Number(x.DISCOUNT);
        }
        if(x.CHARGE_PARTITION_CODE == 'S'||x.CHARGE_PARTITION_CODE == 'N'){
          x.PART_SALES_AMOUNT_DISCOUNT = 0;
        }
        this.pjxm = Number(x.PART_SALES_AMOUNT_DISCOUNT) + this.pjxm;
      });
    },
    // 拿到Fjxm页total
    async detailsFjxm() {
      this.fjxm = 0;
      let res = await detailsFjxm(this.detaildata);
      // ADD_ITEM_AMOUNT附加项目费
      // DISCOUNT折扣率
      // RECEIVE_AMOUNT折扣后附加项目费
      res.data.rows.forEach(x => {
        if (isNaN(Number(x.DISCOUNT)) || isNaN(Number(x.ADD_ITEM_AMOUNT))) {
          x.RECEIVE_AMOUNT = 0;
        } else {
          x.RECEIVE_AMOUNT = Number(x.DISCOUNT) * Number(x.ADD_ITEM_AMOUNT);
        }
        if(x.CHARGE_PARTITION_CODE == 'S'||x.CHARGE_PARTITION_CODE == 'N'){
          x.RECEIVE_AMOUNT = 0;
        }
        this.fjxm = Number(x.RECEIVE_AMOUNT) + this.fjxm;
      });
    },
    async getWxlxSelect() {
      const res = await getWxlxSelect();
      this.formList.find(x => x.fieldName === 'activityType').itemList = res.data.map(x => ({ value: x.REPAIR_TYPE_CODE, text: x.REPAIR_TYPE_NAME }));
      this.repairTypeList = res.data.map(x => ({ value: x.REPAIR_TYPE_CODE, text: x.REPAIR_TYPE_NAME }));
      this.formList.find(x => x.fieldName === 'transferClassCode').itemList = this.repairTypeList;
    }
  }
};
</script>
<style lang="less" scoped>
// .box {
//   border: 1px solid #ccc;
//   padding-top: 15px;
//   padding-right: 15px;
//   border-radius: @borderRadius;
//   margin-bottom: 20px;
//   box-shadow: @boxShadow;
// }
.box_02 {
  text-align: center;
  margin-top: 20px;
}
</style>

// 点击之后的弹框是否确认的方法 // delQuestion() { // this.$confirm('是否确认删除?', '提示', { // confirmButtonText: '确定', // cancelButtonText: '取消', // type: 'warning' // }) // .then(() => { //
this.$emit('close', false); // }) // .catch(() => {}); // },
